#include <windows.h> 

struct subprocess
{
	HANDLE process;
	HANDLE stdin_rd;
	HANDLE stdin_wr;
	HANDLE stdout_rd;
	HANDLE stdout_wr;
};

int subprocess_init(struct subprocess* p);
int subprocess_start(struct subprocess* p, wchar_t* cmd);
int subprocess_exited(struct subprocess* p);
int subprocess_wait(struct subprocess* p);
int subprocess_write(struct subprocess* p, const char* text);
int subprocess_read(struct subprocess* p, char* text, int max_size);
int subprocess_close(struct subprocess* p);
